<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="div-id"></div>
  <div class="div-class"></div>
  <div class="div-class"></div>

  <script>
    let elem, elems

    // querySelector
    elem = document.querySelector('div')
    elem = document.querySelector('#div-id')
    elem = document.querySelector('.div-class')

    // querySelectorAll
    elems = document.querySelectorAll('div')
    elems = document.querySelectorAll('.div-class')
  </script>
</body>

</html>